﻿<%@ WebHandler Language="C#" Class="SysRight_Update" %>

using System;
using System.Web;
using System.Text;
using Newtonsoft.Json;
public class SysRight_Update : IHttpHandler, System.Web.SessionState.IReadOnlySessionState
{
    
    public void ProcessRequest (HttpContext context) {
 //检验是否登录
        OTS.Common.Page<OTS.Model.sys_right> page = new OTS.Common.Page<OTS.Model.sys_right>();
        if (!OTS.BaseLogin.validataModule(context, (int)OTS.enumSysRight.SysRose))
        {
            page.success = false;
            page.msg = "非法操作！";
        }
        else
        {
            string _rid = context.Request["rid"];
            string _rtids = context.Request["rtids"];
           
            OTS.BLL.SysRoseBLL bll = new OTS.BLL.SysRoseBLL();
            if (null != _rid && OTS.Common.Help.IsNumber(_rid) && null != _rtids)
            {
                //if (_rsids.StartsWith(",")) _rsids = _rsids.Substring(1, _rsids.Length);

                bll.UpdateRoseRight(int.Parse(_rid), _rtids);
                page.success = true;
            }
            else
            {
                page.success = false;
            }
  
        }

        context.Response.ContentType = "application/x-json";
        context.Response.Charset = "utf-8";
        context.Response.Write(JavaScriptConvert.SerializeObject(page));
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}